package cn.tedu.m1;

import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class Producer {
    @Autowired
    private AmqpTemplate t;

    //生成者的发送方法，需要手动调用
    public void send(){
        //自动转成byte[]再发送
        t.convertAndSend("helloworld","HelloWorld!");
    }
}
